package com.wwz.frame.config;

import com.wwz.frame.listener.ContextListener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**  
* @Description 监听配置 只会执行一次
* @Author wwz
* @Date 2019/08/26
* @Param   
* @Return   
*/ 
@Configuration
public class ListenerConfig {
    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean() {
        ServletListenerRegistrationBean slrBean = new ServletListenerRegistrationBean();
        slrBean.setListener(new ContextListener());
        return slrBean;
    }
}
